<?php

class Application_Model_WayLog extends Application_Model_DomainObject{
    
    protected $_id;
    
    protected $_description;
    
    protected $_dateCreated;
    
    protected $_isShowFront;
    
    protected $_wayId;
    
    protected $_operator;

    protected $_operateType;
    
    const Type_BillVolume = 201;
    
    const Type_BillAffirmAgent = 202;
    
    const Type_BillAffirmChannel = 203;

    /**
     * 根据运单ID返回运单的操作日志
     * @param type $wayId
     */
    public static function getByWayId($wayId){
        return self::getDao()->queryAll(array('wayId'=>$wayId));
    }
    
    public static function getByWayIdInterior($wayId,$interior)
    {
        return self::getDao()->queryOne(array("wayId"=>$wayId,"operateType"=>$interior));
    }
    
    public function getDescriptionByAgent()
    {
        return Application_Model_AgentCompany::load($this->_description);
    }
    
    public function getDescriptionByChannel()
    {
        return Application_Model_ExpressChannel::load($this->_description);
    }
    
    public function getDescriptionByExpressId()
    {
        return Application_Model_Expressbychannel::getChannelIdByExpress($this->_description);
    }
}